class Solution:
    def maskPII(self, s: str) -> str:
        if "@" in s:
            s = s.lower()
            pos = s.index("@")
            return s[0] + "*****" + s[pos - 1 :]
        else:
            for sym in "+-() ":
                s = s.replace(sym, "")
            result = "***-***-" + s[-4:]
            if len(s) > 10:
                result = "+" + "*" * (len(s) - 10) + "-" + result
            return result
